<template>
    <div>
        <div class="m-alert">
            <span class="el-icon-info"></span>
            <div>
                <div>将已选择的{{ clientNum }}个客户批量添加评分，总评分最高1000</div>
            </div>
        </div>

        <div class="interspaceH"></div>

        <div>
            <div>将客户修改评分，此次</div>
            <el-input placeholder="请输入内容" v-model="rateForm.clientRate" class="input-with-select" @input="rateChange">
                <el-select v-model="rateForm.clientRateType" slot="prepend" style="width: 100px;">
                    <el-option label="添加" value="1"></el-option>
                    <el-option label="减少" value="2"></el-option>
                </el-select>
                <el-button slot="append">分</el-button>
            </el-input>
        </div>

        <div class="interspaceH"></div>

        <el-input type="textarea" v-model="rateForm.clientRateRemark"></el-input>
    </div>
</template>

<script>
export default {
    name: "client_update_rate",
    props: {
        clientNum: {
            type: [String, Number],
            default() {
                return 0
            }
        }
    },
    data() {
        return {
            rateForm: {
                clientRate: 0,
                clientRateType: '1',
                clientRateRemark: ""
            }
        }
    },
    methods: {
        rateChange(number, a) {
            number = number.replace(/[^0-9]/g,"")
            this.rateForm.clientRate = parseInt(number)
        },
        getData() {
            return this.rateForm
        },
        resetData() {
            this.rateForm = {
                clientRate: 0,
                clientRateType: '1',
                clientRateRemark: ""
            }
        }
    }
}
</script>

<style scoped>
.el-icon-info {
    color: #35abff;
    margin-right: 10px;
}
</style>
